<?php
$this->headTitle('Quản lý Role','append');
?>
<script type="text/javascript">
    function confirmDelete()
    {
        if (confirm ('Delete/Uninstall cannot be undone! Are you sure you want to do this?')) {
                $('#form').submit();
        }
    }
</script>
<!-- Start Table -->
<div class="grid_8">
    <dir class="tc" style="color: green"><?php echo $this->message;?></dir>
    <div class="box-header">
        <span class="fr">
            <input type="text" name="search" value="" id="id_search" placeholder="Search"/>
            <a href="<?php echo $this->actionAdd;?>">
                    <input value="Add new" class="button small" type="button">
            </a>
            <a onclick="confirmDelete();">
                    <input value="Delete" class="button small" type="button">
            </a>
        </span>
        Phân quyền
    </div>
    <div class="box table">
	<table cellspacing="0">
            <thead>
                <tr>
                    <td class="tc"><input type="checkbox" value="" onclick="$('input[name*=\'selected\']').attr('checked', this.checked);" /></td>
                    <td class="tc">Role Id</td>
                    <td class="tc">Role Name</td>
                    <td class="tc">Action</td>
                </tr>
            </thead>
            <tbody>
                <form action="<?php echo $this->actionDelete?>" method="post" enctype="multipart/form-data" id="form" name="form">
                    <?php foreach ($this->roles as $r){?>
                    <tr id="row<?php echo $this->escape($r->id);?>">
                    <td class="tc"><input type="checkbox" name="selected[]" value="<?php echo $this->escape($r->id)?>" class="checkbox" /></td>
                    <td class="tc"><?php echo $this->escape($r->id);?></td>
                    <td><?php echo $this->escape($r->roleName);?></td>
                    <td class="tc">
                        <a href="<?php echo $this->actionEdit . '/itemId/' . $r->id?>">
                        <img src="img/icons/small/page_edit.png" alt="edit post" border="0"></a> 
                    </td>
                </tr>
                <?php }?>
                </form>
            </tbody>
        </table>
    </div>
    <div class="pagination">
        <?php echo $this->paginationControl($this->paginator, 'Elastic' , 'paginator.phtml',array('currentUrl'=>$this->actionMain)); ?>
    </div>
</div>
<!-- End Table -->


<!-- Start Formatting -->
<div class="grid_4">
	<div class="box-header">Hướng dẫn</div>
	<div class="box">Instructions for dummies</div>
</div>
<br class="cl" />
<!-- End Formatting -->

